#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>

class Solution {
public:
    int findPoisonedDuration(vector<int>& timeSeries, int duration) {
        int ret = 0;
        for (int i = 1;i < timeSeries.size();i++)
        {
            int temp = timeSeries[i] - timeSeries[i - 1];
            if (temp >= duration)
                ret += duration;
            else
                ret += temp;
        }
        return ret + duration;
    }
};

int main()
{
	return 0;
}